load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("//build:STRINGER.bzl", "stringer")
load("//pkg/testutils:buildutil/buildutil.bzl", "disallowed_imports_test")
load("//pkg/util/fsm/gen:REPORTS.bzl", "gen_reports")

go_library(
    name = "sql",
    srcs = [
        "add_column.go",
        "alter_column_type.go",
        "alter_database.go",
        "alter_default_privileges.go",
        "alter_function.go",
        "alter_index.go",
        "alter_index_visible.go",
        "alter_primary_key.go",
        "alter_role.go",
        "alter_schema.go",
        "alter_sequence.go",
        "alter_table.go",
        "alter_table_locality.go",
        "alter_table_owner.go",
        "alter_table_set_schema.go",
        "alter_type.go",
        "analyze_expr.go",
        "apply_join.go",
        "audit_logging.go",
        "authorization.go",
        "backfill.go",
        "buffer.go",
        "buffer_util.go",
        "cancel_queries.go",
        "cancel_sessions.go",
        "check.go",
        "closed_session_cache.go",
        "comment.go",
        "comment_on_column.go",
        "comment_on_constraint.go",
        "comment_on_database.go",
        "comment_on_index.go",
        "comment_on_schema.go",
        "comment_on_table.go",
        "comment_on_type.go",
        "compact_sql_stats.go",
        "completions.go",
        "conn_executor.go",
        "conn_executor_ddl.go",
        "conn_executor_exec.go",
        "conn_executor_jobs.go",
        "conn_executor_prepare.go",
        "conn_executor_savepoints.go",
        "conn_executor_show_commit_timestamp.go",
        "conn_fsm.go",
        "conn_io.go",
        "control_jobs.go",
        "control_schedules.go",
        "copy_file_upload.go",
        "copy_from.go",
        "copy_to.go",
        "crdb_internal.go",
        "create_database.go",
        "create_extension.go",
        "create_external_connection.go",
        "create_function.go",
        "create_index.go",
        "create_role.go",
        "create_schema.go",
        "create_sequence.go",
        "create_stats.go",
        "create_table.go",
        "create_tenant.go",
        "create_type.go",
        "create_view.go",
        "created_sequence.go",
        "data_source.go",
        "database.go",
        "database_region_change_finalizer.go",
        "deallocate.go",
        "delayed.go",
        "delete.go",
        "delete_range.go",
        "descriptor.go",
        "discard.go",
        "distinct.go",
        "distsql_physical_planner.go",
        "distsql_plan_backfill.go",
        "distsql_plan_bulk.go",
        "distsql_plan_changefeed.go",
        "distsql_plan_ctas.go",
        "distsql_plan_join.go",
        "distsql_plan_set_op.go",
        "distsql_plan_stats.go",
        "distsql_plan_window.go",
        "distsql_running.go",
        "distsql_spec_exec_factory.go",
        "doc.go",
        "drop_cascade.go",
        "drop_database.go",
        "drop_external_connection.go",
        "drop_function.go",
        "drop_index.go",
        "drop_owned_by.go",
        "drop_role.go",
        "drop_schema.go",
        "drop_sequence.go",
        "drop_table.go",
        "drop_tenant.go",
        "drop_trigger.go",
        "drop_type.go",
        "drop_view.go",
        "error_hints.go",
        "error_if_rows.go",
        "event_log.go",
        "exec_factory_util.go",
        "exec_log.go",
        "exec_util.go",
        "execute.go",
        "executor_statement_metrics.go",
        "explain_bundle.go",
        "explain_ddl.go",
        "explain_plan.go",
        "explain_vec.go",
        "export.go",
        "filter.go",
        "fingerprint_span.go",
        "function_references.go",
        "generate_objects.go",
        "gossip.go",
        "grant_revoke.go",
        "grant_revoke_system.go",
        "grant_role.go",
        "group.go",
        "history_retention_job.go",
        "identify_system.go",
        "index_backfiller.go",
        "index_join.go",
        "index_split_scatter.go",
        "information_schema.go",
        "insert.go",
        "insert_fast_path.go",
        "instrumentation.go",
        "internal.go",
        "internal_result_channel.go",
        "inverted_filter.go",
        "inverted_join.go",
        "job_exec_context.go",
        "job_exec_context_test_util.go",
        "jobs_collection.go",
        "jobs_profiler_execution_details.go",
        "join.go",
        "join_predicate.go",
        "limit.go",
        "lookup_join.go",
        "max_one_row.go",
        "mem_metrics.go",
        "mvcc_backfiller.go",
        "mvcc_statistics_update_job.go",
        "name_util.go",
        "notice.go",
        "opaque.go",
        "opt_catalog.go",
        "opt_exec_factory.go",
        "ordinality.go",
        "partition.go",
        "partition_utils.go",
        "pg_catalog.go",
        "pg_extension.go",
        "pg_metadata_diff.go",
        "plan.go",
        "plan_batch.go",
        "plan_columns.go",
        "plan_node_to_row_source.go",
        "plan_opt.go",
        "plan_ordering.go",
        "planhook.go",
        "planner.go",
        "prepared_stmt.go",
        "privileged_accessor.go",
        "project_set.go",
        "reassign_owned_by.go",
        "recursive_cte.go",
        "reference_provider.go",
        "refresh_materialized_view.go",
        "region_util.go",
        "relocate.go",
        "relocate_range.go",
        "rename_column.go",
        "rename_database.go",
        "rename_index.go",
        "rename_table.go",
        "rename_tenant.go",
        "render.go",
        "repair.go",
        "reparent_database.go",
        "resolve_oid.go",
        "resolver.go",
        "restricted_system_interface.go",
        "revert.go",
        "revoke_role.go",
        "routine.go",
        "row_source_to_plan_node.go",
        "save_table.go",
        "scan.go",
        "scatter.go",
        "schema.go",
        "schema_change_cluster_setting.go",
        "schema_change_plan_node.go",
        "schema_changer.go",
        "schema_changer_metrics.go",
        "schema_changer_state.go",
        "schema_resolver.go",
        "scrub.go",
        "scrub_constraint.go",
        "scrub_fk.go",
        "scrub_index.go",
        "scrub_unique_constraint.go",
        "sequence.go",
        "sequence_select.go",
        "serial.go",
        "session_revival_token.go",
        "session_state.go",
        "set_cluster_setting.go",
        "set_schema.go",
        "set_session_authorization.go",
        "set_session_characteristics.go",
        "set_transaction.go",
        "set_var.go",
        "set_zone_config.go",
        "show_cluster_setting.go",
        "show_create.go",
        "show_create_clauses.go",
        "show_create_external_connection.go",
        "show_create_schedule.go",
        "show_external_connection.go",
        "show_fingerprints.go",
        "show_histogram.go",
        "show_stats.go",
        "show_tenant.go",
        "show_trace.go",
        "show_trace_replica.go",
        "show_var.go",
        "show_zone_config.go",
        "sort.go",
        "split.go",
        "spool.go",
        "sql_activity_update_job.go",
        "sql_cursor.go",
        "statement.go",
        "subquery.go",
        "table.go",
        "tablewriter.go",
        "tablewriter_delete.go",
        "tablewriter_insert.go",
        "tablewriter_update.go",
        "tablewriter_upsert_opt.go",
        "telemetry.go",
        "telemetry_logging.go",
        "temporary_schema.go",
        "tenant_accessors.go",
        "tenant_capability.go",
        "tenant_creation.go",
        "tenant_deletion.go",
        "tenant_gc.go",
        "tenant_service.go",
        "tenant_settings.go",
        "tenant_spec.go",
        "tenant_update.go",
        "testutils.go",
        "topk.go",
        "truncate.go",
        "txn_fingerprint_id_cache.go",
        "txn_state.go",
        "type_change.go",
        "unary.go",
        "union.go",
        "unlisten.go",
        "unsplit.go",
        "unsupported_vars.go",
        "update.go",
        "upsert.go",
        "user.go",
        "values.go",
        "vars.go",
        "views.go",
        "virtual_schema.go",
        "virtual_table.go",
        "walk.go",
        "window.go",
        "zero.go",
        "zigzag_join.go",
        "zone_config.go",
        "zone_config_helper.go",
        ":gen-advancecode-stringer",  # keep
        ":gen-nodestatus-stringer",  # keep
        ":gen-txneventtype-stringer",  # keep
        ":gen-txntype-stringer",  # keep
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/build",
        "//pkg/cloud",
        "//pkg/cloud/externalconn",
        "//pkg/clusterversion",
        "//pkg/col/coldata",
        "//pkg/col/coldataext",
        "//pkg/config",
        "//pkg/config/zonepb",
        "//pkg/docs",
        "//pkg/featureflag",
        "//pkg/geo/geoindex",
        "//pkg/geo/geopb",
        "//pkg/geo/geoprojbase",
        "//pkg/gossip",
        "//pkg/inspectz/inspectzpb",
        "//pkg/jobs",
        "//pkg/jobs/jobsauth",
        "//pkg/jobs/jobspb",
        "//pkg/jobs/jobsprofiler/profilerconstants",
        "//pkg/jobs/jobsprotectedts",
        "//pkg/keys",
        "//pkg/keyvisualizer",
        "//pkg/kv",
        "//pkg/kv/kvclient",
        "//pkg/kv/kvclient/kvcoord",
        "//pkg/kv/kvclient/kvtenant",
        "//pkg/kv/kvclient/rangecache",
        "//pkg/kv/kvclient/rangefeed",
        "//pkg/kv/kvclient/rangefeed/rangefeedcache",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/concurrency/isolation",
        "//pkg/kv/kvserver/concurrency/lock",
        "//pkg/kv/kvserver/kvflowcontrol/kvflowinspectpb",
        "//pkg/kv/kvserver/kvserverbase",
        "//pkg/kv/kvserver/liveness/livenesspb",
        "//pkg/kv/kvserver/protectedts",
        "//pkg/kv/kvserver/protectedts/ptpb",
        "//pkg/multitenant",
        "//pkg/multitenant/mtinfo",
        "//pkg/multitenant/mtinfopb",
        "//pkg/multitenant/multitenantcpu",
        "//pkg/multitenant/tenantcapabilities",
        "//pkg/multitenant/tenantcapabilities/tenantcapabilitiespb",
        "//pkg/obs",
        "//pkg/obsservice/obspb",
        "//pkg/obsservice/obspb/opentelemetry-proto/common/v1:common",
        "//pkg/obsservice/obspb/opentelemetry-proto/logs/v1:logs",
        "//pkg/repstream",
        "//pkg/repstream/streampb",
        "//pkg/roachpb",
        "//pkg/rpc",
        "//pkg/rpc/nodedialer",
        "//pkg/scheduledjobs",
        "//pkg/security",
        "//pkg/security/distinguishedname",
        "//pkg/security/password",
        "//pkg/security/sessionrevival",
        "//pkg/security/username",
        "//pkg/server/pgurl",
        "//pkg/server/serverpb",
        "//pkg/server/settingswatcher",
        "//pkg/server/status/statuspb",
        "//pkg/server/telemetry",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/spanconfig",
        "//pkg/spanconfig/spanconfigbounds",
        "//pkg/sql/appstatspb",
        "//pkg/sql/auditlogging",
        "//pkg/sql/auditlogging/auditevents",
        "//pkg/sql/backfill",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/bootstrap",
        "//pkg/sql/catalog/catalogkeys",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/catformat",
        "//pkg/sql/catalog/catpb",
        "//pkg/sql/catalog/catprivilege",
        "//pkg/sql/catalog/catsessiondata",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/catalog/dbdesc",
        "//pkg/sql/catalog/descbuilder",
        "//pkg/sql/catalog/descidgen",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/catalog/fetchpb",
        "//pkg/sql/catalog/funcdesc",
        "//pkg/sql/catalog/funcinfo",
        "//pkg/sql/catalog/lease",
        "//pkg/sql/catalog/multiregion",
        "//pkg/sql/catalog/nstree",
        "//pkg/sql/catalog/randgen",
        "//pkg/sql/catalog/resolver",
        "//pkg/sql/catalog/schemadesc",
        "//pkg/sql/catalog/schemaexpr",
        "//pkg/sql/catalog/schematelemetry/schematelemetrycontroller",
        "//pkg/sql/catalog/seqexpr",
        "//pkg/sql/catalog/systemschema",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/catalog/typedesc",
        "//pkg/sql/catalog/zone",
        "//pkg/sql/clusterunique",
        "//pkg/sql/colexec",
        "//pkg/sql/colexecerror",
        "//pkg/sql/colfetcher",
        "//pkg/sql/colflow",
        "//pkg/sql/colmem",
        "//pkg/sql/compengine",
        "//pkg/sql/comprules",
        "//pkg/sql/contention",
        "//pkg/sql/contention/txnidcache",
        "//pkg/sql/contentionpb",
        "//pkg/sql/covering",
        "//pkg/sql/decodeusername",
        "//pkg/sql/delegate",
        "//pkg/sql/descmetadata",
        "//pkg/sql/distsql",
        "//pkg/sql/enum",
        "//pkg/sql/evalcatalog",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfra/execagg",
        "//pkg/sql/execinfra/execopnode",
        "//pkg/sql/execinfra/execreleasable",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/execstats",
        "//pkg/sql/exprutil",
        "//pkg/sql/faketreeeval",
        "//pkg/sql/flowinfra",
        "//pkg/sql/gcjob/gcjobnotifier",
        "//pkg/sql/gpq",
        "//pkg/sql/idxrecommendations",
        "//pkg/sql/idxusage",
        "//pkg/sql/inverted",
        "//pkg/sql/isql",
        "//pkg/sql/lex",
        "//pkg/sql/lexbase",
        "//pkg/sql/memsize",
        "//pkg/sql/mutations",
        "//pkg/sql/oidext",
        "//pkg/sql/opt",
        "//pkg/sql/opt/cat",
        "//pkg/sql/opt/constraint",
        "//pkg/sql/opt/exec",
        "//pkg/sql/opt/exec/execbuilder",
        "//pkg/sql/opt/exec/explain",
        "//pkg/sql/opt/indexrec",
        "//pkg/sql/opt/memo",
        "//pkg/sql/opt/norm",
        "//pkg/sql/opt/optbuilder",
        "//pkg/sql/opt/xform",
        "//pkg/sql/optionalnodeliveness",
        "//pkg/sql/paramparse",
        "//pkg/sql/parser",
        "//pkg/sql/parser/statements",
        "//pkg/sql/pgrepl/lsn",
        "//pkg/sql/pgrepl/lsnutil",
        "//pkg/sql/pgrepl/pgrepltree",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/pgwire/pgnotice",
        "//pkg/sql/pgwire/pgwirebase",
        "//pkg/sql/pgwire/pgwirecancel",
        "//pkg/sql/physicalplan",
        "//pkg/sql/physicalplan/replicaoracle",
        "//pkg/sql/plpgsql/parser:plpgparser",
        "//pkg/sql/privilege",
        "//pkg/sql/protoreflect",
        "//pkg/sql/querycache",
        "//pkg/sql/regionliveness",
        "//pkg/sql/regions",
        "//pkg/sql/roleoption",
        "//pkg/sql/row",
        "//pkg/sql/rowcontainer",
        "//pkg/sql/rowenc",
        "//pkg/sql/rowexec",
        "//pkg/sql/rowinfra",
        "//pkg/sql/scheduledlogging",
        "//pkg/sql/schemachange",
        "//pkg/sql/schemachanger/scbuild",
        "//pkg/sql/schemachanger/scdeps",
        "//pkg/sql/schemachanger/scerrors",
        "//pkg/sql/schemachanger/scexec",
        "//pkg/sql/schemachanger/scexec/backfiller",
        "//pkg/sql/schemachanger/scop",
        "//pkg/sql/schemachanger/scpb",
        "//pkg/sql/schemachanger/scplan",
        "//pkg/sql/schemachanger/scrun",
        "//pkg/sql/scrub",
        "//pkg/sql/sem/asof",
        "//pkg/sql/sem/builtins",
        "//pkg/sql/sem/builtins/builtinsregistry",
        "//pkg/sql/sem/cast",
        "//pkg/sql/sem/catconstants",
        "//pkg/sql/sem/catid",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/plpgsqltree",
        "//pkg/sql/sem/plpgsqltree/utils",
        "//pkg/sql/sem/semenumpb",
        "//pkg/sql/sem/transform",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sem/tree/treebin",
        "//pkg/sql/sem/tree/treecmp",
        "//pkg/sql/sem/tree/treewindow",
        "//pkg/sql/sem/volatility",
        "//pkg/sql/sessiondata",
        "//pkg/sql/sessiondatapb",
        "//pkg/sql/sessioninit",
        "//pkg/sql/sessionphase",
        "//pkg/sql/sessionprotectedts",
        "//pkg/sql/span",
        "//pkg/sql/sqlclustersettings",
        "//pkg/sql/sqlerrors",
        "//pkg/sql/sqlfsm",
        "//pkg/sql/sqlinstance",
        "//pkg/sql/sqlliveness",
        "//pkg/sql/sqlstats",
        "//pkg/sql/sqlstats/insights",
        "//pkg/sql/sqlstats/persistedsqlstats",
        "//pkg/sql/sqlstats/persistedsqlstats/sqlstatsutil",
        "//pkg/sql/sqlstats/sslocal",
        "//pkg/sql/sqltelemetry",
        "//pkg/sql/stats",
        "//pkg/sql/stats/bounds",
        "//pkg/sql/stmtdiagnostics",
        "//pkg/sql/storageparam",
        "//pkg/sql/storageparam/indexstorageparam",
        "//pkg/sql/storageparam/tablestorageparam",
        "//pkg/sql/syntheticprivilege",
        "//pkg/sql/syntheticprivilegecache",
        "//pkg/sql/ttl/ttlbase",
        "//pkg/sql/types",
        "//pkg/sql/vtable",
        "//pkg/storage",
        "//pkg/storage/enginepb",
        "//pkg/testutils/serverutils",
        "//pkg/upgrade",
        "//pkg/upgrade/upgradebase",
        "//pkg/util",
        "//pkg/util/admission",
        "//pkg/util/admission/admissionpb",
        "//pkg/util/bitarray",
        "//pkg/util/buildutil",
        "//pkg/util/cache",
        "//pkg/util/cancelchecker",
        "//pkg/util/cidr",
        "//pkg/util/collatedstring",
        "//pkg/util/ctxgroup",
        "//pkg/util/ctxlog",
        "//pkg/util/duration",
        "//pkg/util/encoding",
        "//pkg/util/encoding/csv",
        "//pkg/util/envutil",
        "//pkg/util/errorutil",
        "//pkg/util/errorutil/unimplemented",
        "//pkg/util/fsm",
        "//pkg/util/growstack",
        "//pkg/util/grpcutil",
        "//pkg/util/grunning",
        "//pkg/util/hlc",
        "//pkg/util/humanizeutil",
        "//pkg/util/interval",
        "//pkg/util/intsets",
        "//pkg/util/ioctx",
        "//pkg/util/iterutil",
        "//pkg/util/json",
        "//pkg/util/log",
        "//pkg/util/log/eventpb",
        "//pkg/util/log/logcrash",
        "//pkg/util/log/logpb",
        "//pkg/util/log/severity",
        "//pkg/util/memzipper",
        "//pkg/util/metamorphic",
        "//pkg/util/metric",
        "//pkg/util/mon",
        "//pkg/util/optional",
        "//pkg/util/pretty",
        "//pkg/util/protoutil",
        "//pkg/util/quotapool",
        "//pkg/util/randutil",
        "//pkg/util/rangedesc",
        "//pkg/util/retry",
        "//pkg/util/ring",
        "//pkg/util/sentryutil",
        "//pkg/util/span",
        "//pkg/util/startup",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/syncutil/singleflight",
        "//pkg/util/timeutil",
        "//pkg/util/timeutil/pgdate",
        "//pkg/util/tochar",
        "//pkg/util/tracing",
        "//pkg/util/tracing/collector",
        "//pkg/util/tracing/tracingpb",
        "//pkg/util/tsearch",
        "//pkg/util/uint128",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_apd_v3//:apd",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_errors//hintdetail",
        "@com_github_cockroachdb_logtags//:logtags",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_dustin_go_humanize//:go-humanize",
        "@com_github_go_ldap_ldap_v3//:ldap",
        "@com_github_gogo_protobuf//proto",
        "@com_github_gogo_protobuf//types",
        "@com_github_lib_pq//:pq",
        "@com_github_lib_pq//oid",
        "@com_github_petermattis_goid//:goid",
        "@com_github_prometheus_client_model//go",
        "@in_gopkg_yaml_v2//:yaml_v2",
        "@io_opentelemetry_go_otel//attribute",
    ],
)

go_test(
    name = "sql_test",
    size = "enormous",
    srcs = [
        "admin_audit_log_test.go",
        "alter_column_type_test.go",
        "ambiguous_commit_test.go",
        "as_of_test.go",
        "authorization_test.go",
        "backfill_num_ranges_in_span_test.go",
        "backfill_protected_timestamp_test.go",
        "backfill_test.go",
        "builtin_mem_usage_test.go",
        "builtin_test.go",
        "check_test.go",
        "closed_session_cache_test.go",
        "comment_on_column_test.go",
        "comment_on_constraint_test.go",
        "comment_on_database_test.go",
        "comment_on_index_test.go",
        "comment_on_schema_test.go",
        "comment_on_table_test.go",
        "conn_executor_internal_test.go",
        "conn_executor_savepoints_test.go",
        "conn_executor_test.go",
        "conn_io_test.go",
        "copy_from_test.go",
        "copy_test.go",
        "copy_to_test.go",
        "crdb_internal_test.go",
        "create_as_test.go",
        "create_function_test.go",
        "create_stats_test.go",
        "create_test.go",
        "database_test.go",
        "delete_preserving_index_test.go",
        "descriptor_mutation_test.go",
        "descriptor_test.go",
        "distsql_physical_planner_test.go",
        "distsql_plan_backfill_test.go",
        "distsql_plan_bulk_test.go",
        "distsql_plan_changefeed_test.go",
        "distsql_plan_set_op_test.go",
        "distsql_plan_stats_test.go",
        "distsql_running_test.go",
        "drop_function_test.go",
        "drop_helpers_test.go",
        "drop_test.go",
        "err_count_test.go",
        "event_log_test.go",
        "exec_util_test.go",
        "explain_bundle_test.go",
        "explain_test.go",
        "explain_tree_test.go",
        "function_resolver_test.go",
        "generate_objects_test.go",
        "grant_revoke_test.go",
        "grant_role_test.go",
        "index_mutation_test.go",
        "indexbackfiller_test.go",
        "instrumentation_test.go",
        "internal_test.go",
        "jobs_profiler_execution_details_test.go",
        "main_test.go",
        "materialized_view_test.go",
        "mem_limit_test.go",
        "metric_test.go",
        "metric_util_test.go",
        "multitenant_admin_function_test.go",
        "mutation_test.go",
        "mvcc_backfiller_test.go",
        "mvcc_statistics_update_job_test.go",
        "normalization_test.go",
        "pg_metadata_test.go",
        "pg_oid_test.go",
        "pgwire_internal_test.go",
        "plan_opt_test.go",
        "prepared_stmt_test.go",
        "privileged_accessor_test.go",
        "region_util_test.go",
        "rename_test.go",
        "revert_test.go",
        "run_control_test.go",
        "scan_test.go",
        "scatter_test.go",
        "schema_changer_helpers_test.go",
        "schema_changer_test.go",
        "schema_resolver_test.go",
        "scrub_test.go",
        "sequence_test.go",
        "server_params_test.go",
        "session_migration_test.go",
        "set_zone_config_test.go",
        "show_cluster_setting_test.go",
        "show_create_all_tables_builtin_test.go",
        "show_create_table_test.go",
        "show_fingerprints_test.go",
        "show_ranges_test.go",
        "show_stats_test.go",
        "show_test.go",
        "show_trace_replica_test.go",
        "sort_test.go",
        "split_test.go",
        "sql_activity_update_job_test.go",
        "sql_cursor_test.go",
        "sql_exec_log_test.go",
        "sql_prepare_test.go",
        "statement_mark_redaction_test.go",
        "table_ref_test.go",
        "table_test.go",
        "telemetry_datadriven_test.go",
        "telemetry_logging_test.go",
        "telemetry_test.go",
        "temporary_schema_test.go",
        "tenant_test.go",
        "trace_test.go",
        "txn_fingerprint_id_cache_test.go",
        "txn_restart_test.go",
        "txn_state_test.go",
        "type_change_test.go",
        "unique_without_index_test.go",
        "unsplit_range_test.go",
        "unsplit_test.go",
        "upsert_test.go",
        "user_test.go",
        "values_test.go",
        "virtual_schema_test.go",
        "virtual_table_test.go",
        "zone_config_test.go",
        "zone_test.go",
    ],
    data = glob(["testdata/**"]) + [
        "//c-deps:libgeos",
        "//pkg/sql:information_schema.go",
        "//pkg/sql:pg_catalog.go",
        "//pkg/sql/vtable:information_schema.go",
        "//pkg/sql/vtable:pg_catalog.go",
    ],
    embed = [":sql"],
    exec_properties = {
        "Pool": "heavy",
    },
    shard_count = 16,
    deps = [
        "//pkg/base",
        "//pkg/build/bazel",
        "//pkg/ccl",
        "//pkg/ccl/backupccl",
        "//pkg/ccl/changefeedccl/schemafeed/schematestutils",
        "//pkg/cloud/impl:cloudimpl",
        "//pkg/clusterversion",
        "//pkg/col/coldata",
        "//pkg/config",
        "//pkg/config/zonepb",
        "//pkg/gossip",
        "//pkg/internal/sqlsmith",
        "//pkg/jobs",
        "//pkg/jobs/jobspb",
        "//pkg/jobs/jobsprofiler",
        "//pkg/jobs/jobsprofiler/profilerconstants",
        "//pkg/jobs/jobsprotectedts",
        "//pkg/jobs/jobstest",
        "//pkg/keys",
        "//pkg/keyvisualizer",
        "//pkg/kv",
        "//pkg/kv/kvclient",
        "//pkg/kv/kvclient/kvcoord",
        "//pkg/kv/kvclient/kvtenant",
        "//pkg/kv/kvclient/rangecache",
        "//pkg/kv/kvclient/rangefeed",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/kv/kvserver/concurrency/isolation",
        "//pkg/kv/kvserver/kvserverbase",
        "//pkg/kv/kvserver/protectedts",
        "//pkg/kv/kvserver/protectedts/ptpb",
        "//pkg/kv/kvserver/protectedts/ptstorage",
        "//pkg/multitenant/tenantcapabilities",
        "//pkg/roachpb",
        "//pkg/rpc",
        "//pkg/scheduledjobs",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/server/serverpb",
        "//pkg/server/settingswatcher",
        "//pkg/server/srvtestutils",
        "//pkg/server/status",
        "//pkg/server/status/statuspb",
        "//pkg/server/telemetry",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/spanconfig",
        "//pkg/spanconfig/spanconfigptsreader",
        "//pkg/sql/appstatspb",
        "//pkg/sql/backfill",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/bootstrap",
        "//pkg/sql/catalog/catalogkeys",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/catpb",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/catalog/descidgen",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/catalog/desctestutils",
        "//pkg/sql/catalog/fetchpb",
        "//pkg/sql/catalog/funcdesc",
        "//pkg/sql/catalog/lease",
        "//pkg/sql/catalog/multiregion",
        "//pkg/sql/catalog/schemadesc",
        "//pkg/sql/catalog/systemschema",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/catalog/typedesc",
        "//pkg/sql/clusterunique",
        "//pkg/sql/contentionpb",
        "//pkg/sql/distsql",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/execstats",
        "//pkg/sql/flowinfra",
        "//pkg/sql/gcjob",
        "//pkg/sql/isql",
        "//pkg/sql/lexbase",
        "//pkg/sql/mutations",
        "//pkg/sql/opt/constraint",
        "//pkg/sql/opt/exec",
        "//pkg/sql/opt/exec/explain",
        "//pkg/sql/opt/memo",
        "//pkg/sql/opt/testutils/testcat",
        "//pkg/sql/parser",
        "//pkg/sql/parser/statements",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/pgwire/pgwirebase",
        "//pkg/sql/physicalplan",
        "//pkg/sql/physicalplan/replicaoracle",
        "//pkg/sql/privilege",
        "//pkg/sql/querycache",
        "//pkg/sql/randgen",
        "//pkg/sql/row",
        "//pkg/sql/rowenc",
        "//pkg/sql/rowenc/keyside",
        "//pkg/sql/rowenc/rowencpb",
        "//pkg/sql/rowenc/valueside",
        "//pkg/sql/rowexec",
        "//pkg/sql/rowinfra",
        "//pkg/sql/schemachanger/scexec",
        "//pkg/sql/schemachanger/scop",
        "//pkg/sql/schemachanger/scplan",
        "//pkg/sql/scrub",
        "//pkg/sql/scrub/scrubtestutils",
        "//pkg/sql/sem/builtins",
        "//pkg/sql/sem/builtins/builtinsregistry",
        "//pkg/sql/sem/catconstants",
        "//pkg/sql/sem/catid",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sessiondata",
        "//pkg/sql/sessiondatapb",
        "//pkg/sql/sessionphase",
        "//pkg/sql/sqlclustersettings",
        "//pkg/sql/sqlerrors",
        "//pkg/sql/sqlinstance",
        "//pkg/sql/sqlliveness",
        "//pkg/sql/sqlliveness/sqllivenesstestutils",
        "//pkg/sql/sqlstats",
        "//pkg/sql/sqlstats/persistedsqlstats",
        "//pkg/sql/sqlstats/persistedsqlstats/sqlstatsutil",
        "//pkg/sql/sqlstats/sslocal",
        "//pkg/sql/sqltestutils",
        "//pkg/sql/stats",
        "//pkg/sql/stmtdiagnostics",
        "//pkg/sql/tests",
        "//pkg/sql/types",
        "//pkg/storage",
        "//pkg/storage/enginepb",
        "//pkg/testutils",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/jobutils",
        "//pkg/testutils/kvclientutils",
        "//pkg/testutils/pgtest",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/ts",
        "//pkg/upgrade/upgradebase",
        "//pkg/util",
        "//pkg/util/admission",
        "//pkg/util/bitarray",
        "//pkg/util/buildutil",
        "//pkg/util/caller",
        "//pkg/util/cancelchecker",
        "//pkg/util/ctxgroup",
        "//pkg/util/duration",
        "//pkg/util/encoding",
        "//pkg/util/fsm",
        "//pkg/util/hlc",
        "//pkg/util/httputil",
        "//pkg/util/intsets",
        "//pkg/util/json",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/log/channel",
        "//pkg/util/log/eventpb",
        "//pkg/util/log/logconfig",
        "//pkg/util/log/logpb",
        "//pkg/util/log/logtestutils",
        "//pkg/util/metric",
        "//pkg/util/mon",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "//pkg/util/retry",
        "//pkg/util/shuffle",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "//pkg/util/tracing/tracingpb",
        "//pkg/util/uint128",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_apd_v3//:apd",
        "@com_github_cockroachdb_cockroach_go_v2//crdb",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_errors//oserror",
        "@com_github_cockroachdb_logtags//:logtags",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_gogo_protobuf//proto",
        "@com_github_gogo_protobuf//types",
        "@com_github_jackc_pgconn//:pgconn",
        "@com_github_jackc_pgtype//:pgtype",
        "@com_github_jackc_pgx_v4//:pgx",
        "@com_github_klauspost_compress//zip",
        "@com_github_lib_pq//:pq",
        "@com_github_lib_pq//oid",
        "@com_github_petermattis_goid//:goid",
        "@com_github_pmezard_go_difflib//difflib",
        "@com_github_prometheus_common//expfmt",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
        "@in_gopkg_yaml_v2//:yaml_v2",
        "@org_golang_google_protobuf//proto",
        "@org_golang_x_sync//errgroup",
    ],
)

stringer(
    name = "gen-txneventtype-stringer",
    src = "txn_state.go",
    typ = "txnEventType",
)

stringer(
    name = "gen-txntype-stringer",
    src = "txn_state.go",
    typ = "txnType",
)

stringer(
    name = "gen-advancecode-stringer",
    src = "txn_state.go",
    typ = "advanceCode",
)

stringer(
    name = "gen-nodestatus-stringer",
    src = "distsql_physical_planner.go",
    typ = "NodeStatus",
)

gen_reports(
    name = "txnstatetransitions_report",
    dep = "//pkg/sql",
    starting_state_name = "stateNoTxn",
    transitions_variable = "TxnStateTransitions",
)

disallowed_imports_test(
    "sql",
    # TODO(#81380): This should be flipped to "True".
    disallow_cdeps = False,
)
